const CracoLessPlugin = require('craco-less');
const pxtorem = require("postcss-pxtorem");

module.exports = {
    plugins: [
        {
            plugin: CracoLessPlugin,
            options: {
                lessLoaderOptions: {
                    lessOptions: {
                        modifyVars: { '@primary-color': '#1DA57A' },
                        javascriptEnabled: true,
                    },
                },
            },
        },
    ],
    //rem 适配操作
    style: {
        postcss: {
            mode: 'extends',
            loaderOptions: {
                postcssOptions: {
                    ident: 'postcss',
                    plugins: [
                        [
                            'postcss-pxtorem',
                            {
                                rootValue: 375 / 10, // 根元素字体大小
                                propList: ['*']
                            },
                        ],
                    ],
                },
            },
        },
    },
};